﻿<div ng-controller="Monitor.SdbResource.Domain.Ctrl" ng-container="{}">
   <div style="background:#F4F4F4;" ng-container="{height:57}">
      <div class="nav-new">
         <div ng-click="GotoNodeList()">{{autoLanguage("节点")}}</div>
         <div class="active" ng-click="GotoResources()">{{autoLanguage("资源")}}</div>
         <div ng-click="GotoHostList()">{{autoLanguage("主机")}}</div>
         <!--<div ng-click="GotoUser()">{{autoLanguage("安全")}}</div>-->
      </div>
   </div>
   <div style="padding:8px 15px 10px 15px;" ng-container="{offsetY:-60}">
      <div class="underlineTab" style="padding-top:10px;border-top:2px solid #F0F0F0;" ng-container="{height:50,marginTop:10}">
         <ul class="left">
            <li>
               <a href="#Monitor/SDB-Resources/Session">{{autoLanguage("会话")}}</a>
            </li>
            <li>
               <a href="#Monitor/SDB-Resources/Context">{{autoLanguage("上下文")}}</a>
            </li>
            <li class="active">
               <a href="#Monitor/SDB-Resources/Domain">{{autoLanguage("域")}}</a>
            </li>
            <li>
               <a href="#Monitor/SDB-Resources/Procedure">{{autoLanguage("存储过程")}}</a>
            </li>
            <li>
               <a href="#Monitor/SDB-Resources/Transaction">{{autoLanguage("事务")}}</a>
            </li>
            <!--<li>
               <a>{{autoLanguage("锁")}}</a>
            </li>
            <li>
               <a>{{autoLanguage("慢查询")}}</a>
            </li>-->
            <li>
               <a href="#/Monitor/SDB-Resources/Charts">{{autoLanguage("图表")}}</a>
            </li>
         </ul>
      </div>
      <div ng-container="{height:30,marginTop:10,marginBottom:10}">
         <button class="topBtn" ng-click="ShowCreateDomain()">{{autoLanguage("创建域")}}</button>
         <button class="topBtn" ng-class="{true:'disabled'}[ DomainTable['body'].length == 0 ]" ng-click="ShowDeleteDomain()">{{autoLanguage("删除域")}}</button>
         <button class="topBtn" ng-class="{true:'disabled'}[ DomainTable['body'].length == 0 ]" ng-click="ShowAlterDomain()">{{autoLanguage("编辑域")}}</button>
         <button class="topBtn" ng-click="OpenShowFieldDropdown($event)">{{autoLanguage("选择显示列")}}&nbsp;<i class="fa fa-caret-down"></i></button>
      </div>
      <div ng-dropdown="config in FieldDropdown.config" dropdown-callback="FieldDropdown.callback">
         <label class="Ellipsis" style="padding:5px 10px;display:block;" ng-click="SaveField()"><input type="checkbox" ng-model="config.show" />&nbsp;{{config.field}}</label>
      </div>
      <div ng-windows="config as CreateDomain.config" windows-callback="CreateDomain.callback">
         <div form-create para="config"></div>
      </div>
      <div ng-windows="config as DeleteDomain.config" windows-callback="DeleteDomain.callback">
         <div form-create para="config"></div>
      </div>
      <div ng-windows="config as AlterDomain.config" windows-callback="AlterDomain.callback">
         <div form-create para="config"></div>
      </div>
      <div ng-windows="info as DomainInfo.config" windows-callback="DomainInfo.callback">
         <table class="table loosen border">
            <tr>
               <td style="width:40%;background-color:#F1F4F5;"><b>Key</b></td>
               <td style="width:60%;background-color:#F1F4F5;"><b>Value</b></td>
            </tr>
            <tr>
               <td>Domain</td>
               <td>{{info['Name']}}</td>
            </tr>
            <tr ng-repeat="(key, value) in info track by $index" ng-if="key != 'Name' && key != 'GroupList'">
               <td>{{key}}</td>
               <td>{{value}}</td>
            </tr>
         </table>
      </div>
      <div ng-container="{offsetY:-110}" ng-table="DomainTable['options']" table-title="DomainTable['title']" table-content="DomainInfo in DomainTable['body']" table-callback="DomainTable['callback']">
         <div class="Ellipsis" table-key="Name">
            <a class="linkButton" ng-click="ShowDomain(DomainInfo['Name'])">{{DomainInfo.Name}}</a>
         </div>
         <div class="Ellipsis" table-key="$auto">{{$autoValue}}</div>
      </div>
   </div>
</div>